/*
 * DogeScan.java
 *
 * Created on 15 luglio 2007, 13.00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package dogeScan;

import java.awt.Image;
import java.io.IOException;

/**
 *
 * @author daniele
 */
public abstract class DogeScan {
    
    public DogeScan(){
        scannedPages=0;
    }
    
    public abstract String getDataPath();

    /** returns scanning result in a byte[] */
    public byte[] getScannedImage(){
        return scannedImage;
    }
    
    /** returns last scanned page */
    public abstract byte[] getLastScannedImage();
    
    /** acquire a new page from the scanner */
    protected abstract byte[] acquirePage() throws IOException;

    /** acquire a new page */
    public void scanNewPage() throws IOException {
        scannedPages+=1;
        //...and here should go code for scanning a new page (specific for the subclass...)
    }

    /** acquire again last acquired page */
    public void rescanLastPage() throws IOException{
        //...and here should go code for scanning a new page (specific for the subclass...)
    }

    /** returns number of scanned pages */
    public int getScannedPages() {
        return scannedPages;
    }
    
    public String getScannedMime() {
        return scannedMime;
    }
    
    //number of scanned pages so far
    protected int scannedPages;
    //scanned data
    protected byte[] scannedImage;
    //mimetype of scanned data
    protected String scannedMime;
}
